function count = countNonZeroOne(q)
    count = nnz(q) - sum((q(:) == 1));
end
